Optimal. Leaf size=257 \[ \frac{a^3 \left (72 c^2 d^2-15 c^3 d+2 c^4+180 c d^3+76 d^4\right ) \tan (e+f x)}{30 d^2 f}+\frac{a^3 \left (20 c^2+30 c d+13 d^2\right ) \tanh ^{-1}(\sin (e+f x))}{8 f}+\frac{a^3 \left (2 c^2-15 c d+76 d^2\right ) \tan (e+f x) (c+d \sec (e+f x))^2}{60 d^2 f}+\frac{a^3 \left (-30 c^2 d+4 c^3+146 c d^2+195 d^3\right ) \tan (e+f x) \sec (e+f x)}{120 d f}-\frac{a^3 (2 c-11 d) \tan (e+f x) (c+d \sec (e+f x))^3}{20 d^2 f}+\frac{\tan (e+f x) \left (a^3 \sec (e+f x)+a^3\right ) (c+d \sec (e+f x))^3}{5 d f} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.299609, antiderivative size = 273, normalized size of antiderivative = 1.06, number of steps used = 9, number of rules used = 7, integrand size = 31, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.226, Rules used = {3987, 90, 80, 50, 63, 217, 203} \[ \frac{a^3 \left (20 c^2+30 c d+13 d^2\right ) \tan (e+f x)}{8 f}+\frac{a^4 \left (20 c^2+30 c d+13 d^2\right ) \tan (e+f x) \tan ^{-1}\left (\frac{\sqrt{a-a \sec (e+f x)}}{\sqrt{a (\sec (e+f x)+1)}}\right )}{4 f \sqrt{a-a \sec (e+f x)} \sqrt{a \sec (e+f x)+a}}+\frac{\left (20 c^2+30 c d+13 d^2\right ) \tan (e+f x) \left (a^3 \sec (e+f x)+a^3\right )}{24 f}+\frac{a \left (20 c^2+30 c d+13 d^2\right ) \tan (e+f x) (a \sec (e+f x)+a)^2}{60 f}+\frac{3 d (2 c+d) \tan (e+f x) (a \sec (e+f x)+a)^3}{20 f}+\frac{d \tan (e+f x) (a \sec (e+f x)+a)^3 (c+d \sec (e+f x))}{5 f} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 3987
Rule 90
Rule 80
Rule 50
Rule 63
Rule 217
Rule 203
Rubi steps
\begin{align*} \int \sec (e+f x) (a+a \sec (e+f x))^3 (c+d \sec (e+f x))^2 \, dx &=-\frac{\left (a^2 \tan (e+f x)\right ) \operatorname{Subst}\left (\int \frac{(a+a x)^{5/2} (c+d x)^2}{\sqrt{a-a x}} \, dx,x,\sec (e+f x)\right )}{f \sqrt{a-a \sec (e+f x)} \sqrt{a+a \sec (e+f x)}}\\ &=\frac{d (a+a \sec (e+f x))^3 (c+d \sec (e+f x)) \tan (e+f x)}{5 f}+\frac{\tan (e+f x) \operatorname{Subst}\left (\int \frac{(a+a x)^{5/2} \left (-a^2 \left (5 c^2+3 c d+d^2\right )-3 a^2 d (2 c+d) x\right )}{\sqrt{a-a x}} \, dx,x,\sec (e+f x)\right )}{5 f \sqrt{a-a \sec (e+f x)} \sqrt{a+a \sec (e+f x)}}\\ &=\frac{3 d (2 c+d) (a+a \sec (e+f x))^3 \tan (e+f x)}{20 f}+\frac{d (a+a \sec (e+f x))^3 (c+d \sec (e+f x)) \tan (e+f x)}{5 f}-\frac{\left (a^2 \left (20 c^2+30 c d+13 d^2\right ) \tan (e+f x)\right ) \operatorname{Subst}\left (\int \frac{(a+a x)^{5/2}}{\sqrt{a-a x}} \, dx,x,\sec (e+f x)\right )}{20 f \sqrt{a-a \sec (e+f x)} \sqrt{a+a \sec (e+f x)}}\\ &=\frac{a \left (20 c^2+30 c d+13 d^2\right ) (a+a \sec (e+f x))^2 \tan (e+f x)}{60 f}+\frac{3 d (2 c+d) (a+a \sec (e+f x))^3 \tan (e+f x)}{20 f}+\frac{d (a+a \sec (e+f x))^3 (c+d \sec (e+f x)) \tan (e+f x)}{5 f}-\frac{\left (a^3 \left (20 c^2+30 c d+13 d^2\right ) \tan (e+f x)\right ) \operatorname{Subst}\left (\int \frac{(a+a x)^{3/2}}{\sqrt{a-a x}} \, dx,x,\sec (e+f x)\right )}{12 f \sqrt{a-a \sec (e+f x)} \sqrt{a+a \sec (e+f x)}}\\ &=\frac{a \left (20 c^2+30 c d+13 d^2\right ) (a+a \sec (e+f x))^2 \tan (e+f x)}{60 f}+\frac{3 d (2 c+d) (a+a \sec (e+f x))^3 \tan (e+f x)}{20 f}+\frac{\left (20 c^2+30 c d+13 d^2\right ) \left (a^3+a^3 \sec (e+f x)\right ) \tan (e+f x)}{24 f}+\frac{d (a+a \sec (e+f x))^3 (c+d \sec (e+f x)) \tan (e+f x)}{5 f}-\frac{\left (a^4 \left (20 c^2+30 c d+13 d^2\right ) \tan (e+f x)\right ) \operatorname{Subst}\left (\int \frac{\sqrt{a+a x}}{\sqrt{a-a x}} \, dx,x,\sec (e+f x)\right )}{8 f \sqrt{a-a \sec (e+f x)} \sqrt{a+a \sec (e+f x)}}\\ &=\frac{a^3 \left (20 c^2+30 c d+13 d^2\right ) \tan (e+f x)}{8 f}+\frac{a \left (20 c^2+30 c d+13 d^2\right ) (a+a \sec (e+f x))^2 \tan (e+f x)}{60 f}+\frac{3 d (2 c+d) (a+a \sec (e+f x))^3 \tan (e+f x)}{20 f}+\frac{\left (20 c^2+30 c d+13 d^2\right ) \left (a^3+a^3 \sec (e+f x)\right ) \tan (e+f x)}{24 f}+\frac{d (a+a \sec (e+f x))^3 (c+d \sec (e+f x)) \tan (e+f x)}{5 f}-\frac{\left (a^5 \left (20 c^2+30 c d+13 d^2\right ) \tan (e+f x)\right ) \operatorname{Subst}\left (\int \frac{1}{\sqrt{a-a x} \sqrt{a+a x}} \, dx,x,\sec (e+f x)\right )}{8 f \sqrt{a-a \sec (e+f x)} \sqrt{a+a \sec (e+f x)}}\\ &=\frac{a^3 \left (20 c^2+30 c d+13 d^2\right ) \tan (e+f x)}{8 f}+\frac{a \left (20 c^2+30 c d+13 d^2\right ) (a+a \sec (e+f x))^2 \tan (e+f x)}{60 f}+\frac{3 d (2 c+d) (a+a \sec (e+f x))^3 \tan (e+f x)}{20 f}+\frac{\left (20 c^2+30 c d+13 d^2\right ) \left (a^3+a^3 \sec (e+f x)\right ) \tan (e+f x)}{24 f}+\frac{d (a+a \sec (e+f x))^3 (c+d \sec (e+f x)) \tan (e+f x)}{5 f}+\frac{\left (a^4 \left (20 c^2+30 c d+13 d^2\right ) \tan (e+f x)\right ) \operatorname{Subst}\left (\int \frac{1}{\sqrt{2 a-x^2}} \, dx,x,\sqrt{a-a \sec (e+f x)}\right )}{4 f \sqrt{a-a \sec (e+f x)} \sqrt{a+a \sec (e+f x)}}\\ &=\frac{a^3 \left (20 c^2+30 c d+13 d^2\right ) \tan (e+f x)}{8 f}+\frac{a \left (20 c^2+30 c d+13 d^2\right ) (a+a \sec (e+f x))^2 \tan (e+f x)}{60 f}+\frac{3 d (2 c+d) (a+a \sec (e+f x))^3 \tan (e+f x)}{20 f}+\frac{\left (20 c^2+30 c d+13 d^2\right ) \left (a^3+a^3 \sec (e+f x)\right ) \tan (e+f x)}{24 f}+\frac{d (a+a \sec (e+f x))^3 (c+d \sec (e+f x)) \tan (e+f x)}{5 f}+\frac{\left (a^4 \left (20 c^2+30 c d+13 d^2\right ) \tan (e+f x)\right ) \operatorname{Subst}\left (\int \frac{1}{1+x^2} \, dx,x,\frac{\sqrt{a-a \sec (e+f x)}}{\sqrt{a+a \sec (e+f x)}}\right )}{4 f \sqrt{a-a \sec (e+f x)} \sqrt{a+a \sec (e+f x)}}\\ &=\frac{a^3 \left (20 c^2+30 c d+13 d^2\right ) \tan (e+f x)}{8 f}+\frac{a^4 \left (20 c^2+30 c d+13 d^2\right ) \tan ^{-1}\left (\frac{\sqrt{a-a \sec (e+f x)}}{\sqrt{a+a \sec (e+f x)}}\right ) \tan (e+f x)}{4 f \sqrt{a-a \sec (e+f x)} \sqrt{a+a \sec (e+f x)}}+\frac{a \left (20 c^2+30 c d+13 d^2\right ) (a+a \sec (e+f x))^2 \tan (e+f x)}{60 f}+\frac{3 d (2 c+d) (a+a \sec (e+f x))^3 \tan (e+f x)}{20 f}+\frac{\left (20 c^2+30 c d+13 d^2\right ) \left (a^3+a^3 \sec (e+f x)\right ) \tan (e+f x)}{24 f}+\frac{d (a+a \sec (e+f x))^3 (c+d \sec (e+f x)) \tan (e+f x)}{5 f}\\ \end{align*}
Mathematica [A] time = 2.5544, size = 433, normalized size = 1.68 \[ -\frac{a^3 (\cos (e+f x)+1)^3 \sec ^6\left (\frac{1}{2} (e+f x)\right ) \sec ^5(e+f x) \left (240 \left (20 c^2+30 c d+13 d^2\right ) \cos ^5(e+f x) \left (\log \left (\cos \left (\frac{1}{2} (e+f x)\right )-\sin \left (\frac{1}{2} (e+f x)\right )\right )-\log \left (\sin \left (\frac{1}{2} (e+f x)\right )+\cos \left (\frac{1}{2} (e+f x)\right )\right )\right )-\sec (e) \left (-240 \left (7 c^2+10 c d+3 d^2\right ) \sin (2 e+f x)+80 \left (34 c^2+60 c d+29 d^2\right ) \sin (f x)+360 c^2 \sin (e+2 f x)+360 c^2 \sin (3 e+2 f x)+1840 c^2 \sin (2 e+3 f x)-360 c^2 \sin (4 e+3 f x)+180 c^2 \sin (3 e+4 f x)+180 c^2 \sin (5 e+4 f x)+440 c^2 \sin (4 e+5 f x)+1140 c d \sin (e+2 f x)+1140 c d \sin (3 e+2 f x)+3360 c d \sin (2 e+3 f x)-240 c d \sin (4 e+3 f x)+450 c d \sin (3 e+4 f x)+450 c d \sin (5 e+4 f x)+720 c d \sin (4 e+5 f x)+750 d^2 \sin (e+2 f x)+750 d^2 \sin (3 e+2 f x)+1520 d^2 \sin (2 e+3 f x)+195 d^2 \sin (3 e+4 f x)+195 d^2 \sin (5 e+4 f x)+304 d^2 \sin (4 e+5 f x)\right )\right )}{15360 f} \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A] time = 0.06, size = 342, normalized size = 1.3 \begin{align*}{\frac{5\,{a}^{3}{c}^{2}\ln \left ( \sec \left ( fx+e \right ) +\tan \left ( fx+e \right ) \right ) }{2\,f}}+6\,{\frac{{a}^{3}cd\tan \left ( fx+e \right ) }{f}}+{\frac{13\,{a}^{3}{d}^{2}\sec \left ( fx+e \right ) \tan \left ( fx+e \right ) }{8\,f}}+{\frac{13\,{a}^{3}{d}^{2}\ln \left ( \sec \left ( fx+e \right ) +\tan \left ( fx+e \right ) \right ) }{8\,f}}+{\frac{11\,{a}^{3}{c}^{2}\tan \left ( fx+e \right ) }{3\,f}}+{\frac{15\,{a}^{3}cd\sec \left ( fx+e \right ) \tan \left ( fx+e \right ) }{4\,f}}+{\frac{15\,{a}^{3}cd\ln \left ( \sec \left ( fx+e \right ) +\tan \left ( fx+e \right ) \right ) }{4\,f}}+{\frac{38\,{a}^{3}{d}^{2}\tan \left ( fx+e \right ) }{15\,f}}+{\frac{19\,{a}^{3}{d}^{2}\tan \left ( fx+e \right ) \left ( \sec \left ( fx+e \right ) \right ) ^{2}}{15\,f}}+{\frac{3\,{a}^{3}{c}^{2}\sec \left ( fx+e \right ) \tan \left ( fx+e \right ) }{2\,f}}+2\,{\frac{{a}^{3}cd\tan \left ( fx+e \right ) \left ( \sec \left ( fx+e \right ) \right ) ^{2}}{f}}+{\frac{3\,{a}^{3}{d}^{2}\tan \left ( fx+e \right ) \left ( \sec \left ( fx+e \right ) \right ) ^{3}}{4\,f}}+{\frac{{a}^{3}{c}^{2}\tan \left ( fx+e \right ) \left ( \sec \left ( fx+e \right ) \right ) ^{2}}{3\,f}}+{\frac{{a}^{3}cd\tan \left ( fx+e \right ) \left ( \sec \left ( fx+e \right ) \right ) ^{3}}{2\,f}}+{\frac{{a}^{3}{d}^{2}\tan \left ( fx+e \right ) \left ( \sec \left ( fx+e \right ) \right ) ^{4}}{5\,f}} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [A] time = 1.01397, size = 620, normalized size = 2.41 \begin{align*} \frac{80 \,{\left (\tan \left (f x + e\right )^{3} + 3 \, \tan \left (f x + e\right )\right )} a^{3} c^{2} + 480 \,{\left (\tan \left (f x + e\right )^{3} + 3 \, \tan \left (f x + e\right )\right )} a^{3} c d + 16 \,{\left (3 \, \tan \left (f x + e\right )^{5} + 10 \, \tan \left (f x + e\right )^{3} + 15 \, \tan \left (f x + e\right )\right )} a^{3} d^{2} + 240 \,{\left (\tan \left (f x + e\right )^{3} + 3 \, \tan \left (f x + e\right )\right )} a^{3} d^{2} - 30 \, a^{3} c d{\left (\frac{2 \,{\left (3 \, \sin \left (f x + e\right )^{3} - 5 \, \sin \left (f x + e\right )\right )}}{\sin \left (f x + e\right )^{4} - 2 \, \sin \left (f x + e\right )^{2} + 1} - 3 \, \log \left (\sin \left (f x + e\right ) + 1\right ) + 3 \, \log \left (\sin \left (f x + e\right ) - 1\right )\right )} - 45 \, a^{3} d^{2}{\left (\frac{2 \,{\left (3 \, \sin \left (f x + e\right )^{3} - 5 \, \sin \left (f x + e\right )\right )}}{\sin \left (f x + e\right )^{4} - 2 \, \sin \left (f x + e\right )^{2} + 1} - 3 \, \log \left (\sin \left (f x + e\right ) + 1\right ) + 3 \, \log \left (\sin \left (f x + e\right ) - 1\right )\right )} - 180 \, a^{3} c^{2}{\left (\frac{2 \, \sin \left (f x + e\right )}{\sin \left (f x + e\right )^{2} - 1} - \log \left (\sin \left (f x + e\right ) + 1\right ) + \log \left (\sin \left (f x + e\right ) - 1\right )\right )} - 360 \, a^{3} c d{\left (\frac{2 \, \sin \left (f x + e\right )}{\sin \left (f x + e\right )^{2} - 1} - \log \left (\sin \left (f x + e\right ) + 1\right ) + \log \left (\sin \left (f x + e\right ) - 1\right )\right )} - 60 \, a^{3} d^{2}{\left (\frac{2 \, \sin \left (f x + e\right )}{\sin \left (f x + e\right )^{2} - 1} - \log \left (\sin \left (f x + e\right ) + 1\right ) + \log \left (\sin \left (f x + e\right ) - 1\right )\right )} + 240 \, a^{3} c^{2} \log \left (\sec \left (f x + e\right ) + \tan \left (f x + e\right )\right ) + 720 \, a^{3} c^{2} \tan \left (f x + e\right ) + 480 \, a^{3} c d \tan \left (f x + e\right )}{240 \, f} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A] time = 0.516725, size = 587, normalized size = 2.28 \begin{align*} \frac{15 \,{\left (20 \, a^{3} c^{2} + 30 \, a^{3} c d + 13 \, a^{3} d^{2}\right )} \cos \left (f x + e\right )^{5} \log \left (\sin \left (f x + e\right ) + 1\right ) - 15 \,{\left (20 \, a^{3} c^{2} + 30 \, a^{3} c d + 13 \, a^{3} d^{2}\right )} \cos \left (f x + e\right )^{5} \log \left (-\sin \left (f x + e\right ) + 1\right ) + 2 \,{\left (24 \, a^{3} d^{2} + 8 \,{\left (55 \, a^{3} c^{2} + 90 \, a^{3} c d + 38 \, a^{3} d^{2}\right )} \cos \left (f x + e\right )^{4} + 15 \,{\left (12 \, a^{3} c^{2} + 30 \, a^{3} c d + 13 \, a^{3} d^{2}\right )} \cos \left (f x + e\right )^{3} + 8 \,{\left (5 \, a^{3} c^{2} + 30 \, a^{3} c d + 19 \, a^{3} d^{2}\right )} \cos \left (f x + e\right )^{2} + 30 \,{\left (2 \, a^{3} c d + 3 \, a^{3} d^{2}\right )} \cos \left (f x + e\right )\right )} \sin \left (f x + e\right )}{240 \, f \cos \left (f x + e\right )^{5}} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F] time = 0., size = 0, normalized size = 0. \begin{align*} a^{3} \left (\int c^{2} \sec{\left (e + f x \right )}\, dx + \int 3 c^{2} \sec ^{2}{\left (e + f x \right )}\, dx + \int 3 c^{2} \sec ^{3}{\left (e + f x \right )}\, dx + \int c^{2} \sec ^{4}{\left (e + f x \right )}\, dx + \int d^{2} \sec ^{3}{\left (e + f x \right )}\, dx + \int 3 d^{2} \sec ^{4}{\left (e + f x \right )}\, dx + \int 3 d^{2} \sec ^{5}{\left (e + f x \right )}\, dx + \int d^{2} \sec ^{6}{\left (e + f x \right )}\, dx + \int 2 c d \sec ^{2}{\left (e + f x \right )}\, dx + \int 6 c d \sec ^{3}{\left (e + f x \right )}\, dx + \int 6 c d \sec ^{4}{\left (e + f x \right )}\, dx + \int 2 c d \sec ^{5}{\left (e + f x \right )}\, dx\right ) \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [A] time = 1.28398, size = 532, normalized size = 2.07 \begin{align*} \frac{15 \,{\left (20 \, a^{3} c^{2} + 30 \, a^{3} c d + 13 \, a^{3} d^{2}\right )} \log \left ({\left | \tan \left (\frac{1}{2} \, f x + \frac{1}{2} \, e\right ) + 1 \right |}\right ) - 15 \,{\left (20 \, a^{3} c^{2} + 30 \, a^{3} c d + 13 \, a^{3} d^{2}\right )} \log \left ({\left | \tan \left (\frac{1}{2} \, f x + \frac{1}{2} \, e\right ) - 1 \right |}\right ) - \frac{2 \,{\left (300 \, a^{3} c^{2} \tan \left (\frac{1}{2} \, f x + \frac{1}{2} \, e\right )^{9} + 450 \, a^{3} c d \tan \left (\frac{1}{2} \, f x + \frac{1}{2} \, e\right )^{9} + 195 \, a^{3} d^{2} \tan \left (\frac{1}{2} \, f x + \frac{1}{2} \, e\right )^{9} - 1400 \, a^{3} c^{2} \tan \left (\frac{1}{2} \, f x + \frac{1}{2} \, e\right )^{7} - 2100 \, a^{3} c d \tan \left (\frac{1}{2} \, f x + \frac{1}{2} \, e\right )^{7} - 910 \, a^{3} d^{2} \tan \left (\frac{1}{2} \, f x + \frac{1}{2} \, e\right )^{7} + 2560 \, a^{3} c^{2} \tan \left (\frac{1}{2} \, f x + \frac{1}{2} \, e\right )^{5} + 3840 \, a^{3} c d \tan \left (\frac{1}{2} \, f x + \frac{1}{2} \, e\right )^{5} + 1664 \, a^{3} d^{2} \tan \left (\frac{1}{2} \, f x + \frac{1}{2} \, e\right )^{5} - 2120 \, a^{3} c^{2} \tan \left (\frac{1}{2} \, f x + \frac{1}{2} \, e\right )^{3} - 3660 \, a^{3} c d \tan \left (\frac{1}{2} \, f x + \frac{1}{2} \, e\right )^{3} - 1330 \, a^{3} d^{2} \tan \left (\frac{1}{2} \, f x + \frac{1}{2} \, e\right )^{3} + 660 \, a^{3} c^{2} \tan \left (\frac{1}{2} \, f x + \frac{1}{2} \, e\right ) + 1470 \, a^{3} c d \tan \left (\frac{1}{2} \, f x + \frac{1}{2} \, e\right ) + 765 \, a^{3} d^{2} \tan \left (\frac{1}{2} \, f x + \frac{1}{2} \, e\right )\right )}}{{\left (\tan \left (\frac{1}{2} \, f x + \frac{1}{2} \, e\right )^{2} - 1\right )}^{5}}}{120 \, f} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]